<template>
	<view class="content">
		<image class="logo" src="/static/logo.png"></image>
		<view class="text-area">
			<text class="title">{{jsonData.ip}}</text>
			<text class="title">{{jsonData.addr}}</text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				jsonData: null
			}
		},
		onLoad() {
			var that = this;
			uni.request({
				url: "https://ipv4.gdt.qq.com/get_client_ip",
				method: "GET",
				success: (response) => {
					this.clientIp = response.data;
					uni.request({
						url: 'http://ip.cy0898.com/origip/origip.php?ip=' + this.clientIp,
						method: 'GET',
						success: (res) => {
							this.jsonData = res.data;
						},
					})
				},
			});
		},
		methods: {

		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>